﻿mixin tableTH(titles)
  tr
    each title in titles
      th= title

extends layout_main
block selfQuote
  script(type="text/javascript",src="/javascripts/utility.js")
block body
  .body_resize_pages
    .navleft
      span 请假
        span.icons.icon_paper
      ul.nav.nav-list
        -var LeftMenu = [{name:'休假申请',link:'/Vacation/List'},{name:'我的待办',link:'/Vacation/MyWork'},{name:'审批历史',link:'#'},{name:'假期汇总',link:'#'}];
        each item in LeftMenu
          li
            a(href="#{item.link}",class="#{ title==item.name ? 'active': '' }")
              i.icon-dashboard
              span= item.name
    form.form-horizontal(method="POST")
      .control-groupform
        .control-group
          label.control-label 开始日期
          .controls
            input(type="text",name="startTime")
        .control-group
          label.control-label 结束日期
          .controls
            input(type="text",name="endTime")
        .control-group
          label.control-label 休假类型
          .controls
            select(name="leaveType")
              each type in LeaveTypes
                option(value= "#{type.Id}")= type.LeaveType
        .control-group
          label.control-label 是否调休
          .controls
            select(name="isDaysOff") 
              option(value="-1") 全部
              option(value="1") 是
              option(value="0") 否
        .control-group
          label.control-label  状态
          .controls
            select(name="status") 
              each val in StatusList
                option(value= "#{val.value}")= val.Name

        p(style="float:right;margin:1em 0;")
          button.btn(name="operate",value="view") 查看
          if !isPending
            a.btn(href="#",onclick="openDialog('/Vacation/Detail')") 新建申请
          if isPending
            button.btn(name="operate",value="batchApprove") 批量同意

    .left_pages
      table.table_form(width="100%",border="0",cellpadding="0",cellspacing="1")
        tbody
          +tableTH(["申请员工","开始日期","结束日期","休假类型","休假时长(天)","状态","查看"])
          each app in myVacationApplication
            tr
             td= app.empName + "(" + app.empNo + ")"
             td= app.LeaveBeginTime
             td= app.LeaveEndTime
             td= app.LeaveType
             td= app.SettlementLength /8
             td= app.AppStatus
             if isPending
               td: a(href="#",onclick="openDialog('/Vacation/Detail?Id=#{app.Id}&ope=Approve&Node=#{app.Node}')"): span.icons.icon_search
             else
               td: a(href="#",onclick="openDialog('/Vacation/Detail?Id=#{app.Id}')"): span.icons.icon_search
      .pagination
    .clr
  .clr
      

